package kr.bae.androidcomplete02.ch13;

import kr.bae.androidcomplete02.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.CalendarView;
import android.widget.CalendarView.OnDateChangeListener;
import android.widget.Toast;

public class CalendarViewEx extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.calendarviewex);

		CalendarView calendar = (CalendarView) findViewById(R.id.ch13_calendar);
		calendar.setShowWeekNumber(false);
		calendar.setOnDateChangeListener(new OnDateChangeListener() {

			@Override
			public void onSelectedDayChange(CalendarView view, int year,
					int month, int dayOfMonth) {
				Toast.makeText(getApplication(),
						"" + year + "/" + (month + 1) + "/" + dayOfMonth, 0)
						.show();
			}
		});
	}
}
